package com.makeunion.gdlbsdemo.util;

import com.amap.api.maps.model.LatLng;
import com.amap.api.services.core.LatLonPoint;

import java.util.ArrayList;
import java.util.List;

/**
 * 类说明
 *
 * @author renjialiang
 * @version [版本]
 * @see [相关类]
 * @since [模块]
 */
public class AMapUtil {

    public static LatLng convertToLatLng(LatLonPoint point) {
        return new LatLng(point.getLatitude(), point.getLongitude());
    }

    public static List<LatLng> convertToLatLngList(List<LatLonPoint> pointList) {
        List<LatLng> resultList = new ArrayList<>();
        if (pointList == null) {
            return resultList;
        }
        for (LatLonPoint point : pointList) {
            resultList.add(new LatLng(point.getLatitude(), point.getLongitude()));
        }
        return resultList;
    }
}
